
dbconfig={'host':'10.6.152.100',
          'port':'7306',
          'user': 'root','password':'dev123','database':'test'}
import mysql.connector
conn =mysql.connector.connect(**dbconfig)

cursor = conn.cursor();

_SQL=""" insert into log
        (phrase,letters,ip,browser_string, results)
        values(%s,%s,%s,%s,%s)"""
cursor.execute(_SQL,('wwh','xyz','127.0.0.1','chrome',"{'x','y'}"))
conn.commit()

_SQL="""select * from log """
cursor.execute(_SQL)

for row in cursor.fetchall():
    print(row)
cursor.close()

conn.close()